c# timestamp

51

c# datetime now timestamp -

var Timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();

c# datetime now timestamp -

String timeStamp = GetTimestamp(DateTime.Now);

c# datetime to timestamp -

DateTimeOffset.UtcNow.ToUnixTimeSeconds()

c# timestamp -

public static String GetTimestamp(DateTime value)
{
    return value.ToString("yyyyMMddHHmmssffff");
}
//  ...later on in the code
String timeStamp = GetTimestamp(new DateTime());
Console.WriteLine(timeStamp);

Comments

Submit
0 Comments